package com.zrrd.gmall.webll.controller;

import com.zrrd.gmall.model.order.OrderInfo;
import com.zrrd.gmall.order.fegin.OrderFeginClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class PaymentController {

    @Autowired
    private OrderFeginClient orderFeginClient;

    @GetMapping("/pay.html")
    public String pay(HttpServletRequest request){
        String orderId = request.getParameter("orderId");
        OrderInfo orderInfo = orderFeginClient.getOrderInfo(Long.parseLong(orderId));
        request.setAttribute("orderInfo",orderInfo);
        return "payment/pay";
    }
}
